package com.daohang361.imqq.decoder;

import com.daohang361.imqq.Asycore.QQUser;
import com.daohang361.imqq.tool.MyUtil;

/** 
 * @author naner E-mail:likun3344@163.com 
 * @create time：2011-4-18 上午10:59:32
 *协议格式
 *83 00 66 2B 4F ED 
 *66 2B 4F EC [QQ号码：1714114540]
 *4D 5F 51 3C [M_Q<]
 *2C[长度] 
 *49
 *20 61 72 6D 20 72 6F 62 6F 74 20 20 E6 AC A2 E8
 *BF 8E E5 8A A0 E5 85 A5 51 51 E7 BE A4 37 32 31
 *35 39 38 39 30 E8 81 8A E5 A4 A9[I arm robot  欢迎加入QQ群72159890聊天]
 */
public class Decoder67 extends AbstractDecoder{
	@Override
	public QQUser decode() throws Exception {
		myArray.decryptRemain(sessionQQ.getAttr("SessionKey"));
		myArray.extract(0, 13);
		int tempLength =MyUtil.bytes2Integer(myArray.extract(0, 0));
		byte[] qianming =myArray.extract(0, tempLength-1);
		sessionQQ.addAttr("qianming", qianming);
	System.out.println(new String(qianming,"UTF-8"));
		sessionQQ.setLogintimes(sessionQQ.getLogintimes()+1);//登陆包前进
		sessionQQ.setPakage(sessionQQ.getPakage()+1);//登陆包自动增长
		return sessionQQ;
	}
}
